<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="jquery-ui-bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css" />
    <link rel="stylesheet" href="hallo.css" />
    <link rel="stylesheet" href="fontawesome/css/font-awesome.css" charset="utf-8" />
<!--[if lt IE 9]>
    <link rel="stylesheet" href="fontawesome/css/font-awesome-ie7.css" charset="utf-8" />
<![endif]-->
    <script src="../bower_components/jquery/jquery.js"></script>
    <script src="../bower_components/jquery-ui/ui/jquery-ui.js"></script>
    <script src="../bower_components/rangy-official/rangy-core.js"></script>
    <script src="../dist/hallo.js"></script>
    <title>Hallo example</title>
    <style>
      .inPlaceholderMode{
        color: #ccc;
      }
    </style>
  </head>
  <body>

    <button id="enable">Enable</button>
    <button id="disable">Disable</button>
    <p id="modified">Editables have not been modified</p>

    <h1 class="editable">Hello World</h1>
    <h2 class="editable"></h2>
    <div class="editable">
      <p>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
      </p>
      <p>
        Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
      </p>

      <table>
          <tr>
              <td width="70%">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</td>
              <td width="30%">Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.</td>
          </tr>
      </table>
    </div>

    <script>
      jQuery('#enable').button().click(function() {
        jQuery('.editable').hallo({
          plugins: {
            'halloformat': {},
            'halloblock': {},
            'hallojustify': {},
            'hallolists': {},
            //'hallolink': {},
            'halloreundo': {}
          },
          editable: true,
          placeholder: 'Hello World placeholder'
        });
        jQuery('.editable').bind('hallomodified', function(event, data) {
            jQuery('#modified').html("Editables modified");
        });
        jQuery('.editable').bind('halloselected', function(event, data) {
            jQuery('#modified').html("Selection made");
        });
        jQuery('.editable').bind('hallounselected', function(event, data) {
            jQuery('#modified').html("Selection removed");
        });
        jQuery('.editable').bind('hallorestored', function(event, data) {
            jQuery('#modified').html("restored");
        });
      });
      jQuery('#disable').button().click(function() {
        jQuery('.editable').hallo({editable: false});
      });
      jQuery('.editable').bind('hellodeactivated', function() {
          alert("foobar");
        $(this).hallo({editable:false});
      });
    </script>
  </body>
</html>
